<% layout('/layouts/default.html', {title: '考试报名管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('考试报名管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('zx:barbecue:signup:tbarbecueSignup:edit')){ %>
					<a href="${ctx}/zx/barbecue/signup/tbarbecueSignup/form" class="btn btn-default btnTool" title="${text('新增考生报名')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${tbarbecueSignup}" action="${ctx}/zx/barbecue/signup/tbarbecueSignup/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('考试主键')}：</label>
					<div class="control-inline">
						<#form:input path="barbecueId" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('身份证号')}：</label>
					<div class="control-inline">
						<#form:input path="idCard" maxlength="30" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('考生姓名')}：</label>
					<div class="control-inline">
						<#form:input path="username" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('手机号')}：</label>
					<div class="control-inline">
						<#form:input path="mobile" maxlength="30" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('考生照片')}：</label>
					<div class="control-inline">
						<#form:input path="userPhoto" maxlength="100" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('报名时间')}：</label>
					<div class="control-inline">
						<#form:input path="createUpdate" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('状态')}：</label>
					<div class="control-inline width-120">
						<#form:select path="state" dictType="t_state" blankOption="true" class="form-control isQuick"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('备注')}：</label>
					<div class="control-inline">
						<#form:input path="remarks" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("考试主题")}', name:'barbecueTitle', index:'a.barbecue_title', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/zx/barbecue/signup/tbarbecueSignup/form?id='+row.id+'" class="btnList" data-title="${text("编辑考试报名表")}">'+(val||row.barbecueTitle)+'</a>';
		}},
		{header:'${text("考生姓名")}', name:'username', index:'a.username', width:150, align:"left"},
		{header:'${text("身份证号")}', name:'idCard', index:'a.id_card', width:150, align:"left"},
		{header:'${text("手机号")}', name:'mobile', index:'a.mobile', width:150, align:"left"},
		{header:'${text("考生照片")}', name:'userPhoto', index:'a.user_photo', width:150, align:"left"},
		{header:'${text("报名时间")}',  name:'createDate', index:'a.create_date', width:150, align:"center"},
		{header:'${text("更新时间")}',hidden:true, name:'updateDate', index:'a.update_date', width:150, align:"center"},
		{header:'${text("状态")}', name:'state', index:'a.state', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('t_state')}, val, '${text("未知")}', true);
		}},
		{header:'${text("备注")}', hidden:true,name:'remarks', index:'a.remarks', width:150, align:"left"},
		{header:'${text("操作")}', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('zx:barbecue:signup:tbarbecueSignup:edit')){ %>
				actions.push('<a href="${ctx}/zx/barbecue/signup/tbarbecueSignup/form?id='+row.id+'" class="btnList" title="${text("编辑考试报名表")}"><i class="fa fa-pencil"></i></a>&nbsp;');
				if (row.state == 0){
					actions.push('<a href="${ctx}/zx/barbecue/signup/tbarbecueSignup/enable?id='+row.id+'" class="btnList" title="${text("审核通过")}" data-confirm="${text("确认该操作吗？")}"><i class="glyphicon glyphicon-ok"></i></a>&nbsp;');
					actions.push('<a href="${ctx}/zx/barbecue/signup/tbarbecueSignup/disable?id='+row.id+'" class="btnList" title="${text("审核驳回")}" data-confirm="${text("确认该操作吗？")}"><i class="glyphicon glyphicon-remove"></i></a>&nbsp;');
				}
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>